<?php

namespace app\app\controller;


use app\common\facade\auth\Auth;
use app\model\MobileOrder;

class Order
{
    use \app\common\traits\Order; //统一管理

    /**
     * 话费订单拉取
     */
    public function mobile(){

        $params = input();

        $data = MobileOrder::query()
            ->withSearch(['start_at','end_at'],$params)
            ->field(['user_id','order_id','mobile','sale_price','amount','status','supplier_status','remark','profit','created_at','updated_at'])
            ->append(['openid','final_status'])
            ->hidden(['user_id','user','status','supplier_status'])
            ->where('agent_id',Auth::agentId())
            ->order('updated_at','desc')
            ->paginate();

        return success('',$data);

    }
}